

#import "BasesViewController.h"
#import "MobClick.h"
#import "HeaderModel.h"
#import "DataNetwork.h"
@interface BasesViewController ()
{
    UIView *view;
    UIActivityIndicatorView *activ;
}
@end

@implementation BasesViewController

- (void)viewWillAppear:(BOOL)animated
{
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"返回" style:UIBarButtonItemStyleBordered target:self action:@selector(goBacksActions)];
    
    [super viewWillAppear:animated];
    [MobClick beginLogPageView:self.title];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillAppear:YES];
    [MobClick endLogPageView:self.title];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"arrows.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(goBacksActions)];
    [HeaderModel sharedHeaderModel].sys = @"IOS";//系统类型
    [HeaderModel sharedHeaderModel].sysversion = [DataNetwork getSysversion];
    
    [HeaderModel sharedHeaderModel].app = [DataNetwork getAppWithType:0];//产品类型
    [HeaderModel sharedHeaderModel].appversion = [DataNetwork getAppversion];//产品版本
    [HeaderModel sharedHeaderModel].devicetype =  [DataNetwork getDevicetype];//手机型号
    
    [HeaderModel sharedHeaderModel].nettype = [DataNetwork getNetType];
    //网络类型
    [HeaderModel sharedHeaderModel].primarykey = [DataNetwork uuid] ;//设备号
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self.view endEditing:YES];///
}
#pragma mark -- 返回上一层 --
- (void)goBacksActions
{
    [self.navigationController popViewControllerAnimated:YES];
}
#pragma mark -- 菊花圈加载 --
- (void)activityStart
{
    view = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    view.backgroundColor = [UIColor colorWithWhite:0.f alpha:0.3];
    [self.view addSubview:view];
    
    activ = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
    activ.center = view.center;
    
    activ.color = [UIColor grayColor];
    [view addSubview:activ];
    [activ startAnimating];
}
- (void)activityStop
{
    [activ stopAnimating];
    [view removeFromSuperview];
}
@end
